package deepbitview

class AccessKeyController {

    static allowedMethods = [save: "POST", update: "POST", delete: "POST"]

    def create = {
        def accessKeyInstance = new AccessKey()
        accessKeyInstance.properties = params
        return [accessKeyInstance: accessKeyInstance]
    }

    def save = {
        def accessKeyInstance = new AccessKey(params)
        if (accessKeyInstance.save(flush: true)) {
            flash.message = "${message(code: 'default.created.message', args: [message(code: 'accessKey.label', default: 'AccessKey'), accessKeyInstance.id])}"
            redirect(controller: "overview", action: "index")
        }
        else {
            log.info(accessKeyInstance.errors)
            render(view: "create", model: [accessKeyInstance: accessKeyInstance])
        }
    }

}
